<?php
namespace common\components;

class WebUser extends \yii\web\User{

    public function getName(){
        $identity = $this->getIdentity();
        return $identity !== null ? $identity->name : null;
    }
}